-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[17.0][MIG] sale_pricelist_global_rule: Migration to version 17.0 #3526
base: 17.0
Are you sure you want to change the base?
[17.0][MIG] sale_pricelist_global_rule: Migration to version 17.0 #3526
Conversation
CI is red |
/ocabot migration sale_pricelist_global_rule |
5c871a9
to
58dcdfe
Compare
I found an issue in this PR: OCA/sale-workflow#3150. Please let me know if it’s okay to add this commit to the current PR or if I should create a new, independent PR. |
/ocabot migration sale_pricelist_global_rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review OK.
I think a migration script should be added to update the records that had the value applied_on
4_global_product_template to 3_1_global_product_template and 5_global_product_category to 3_2_global_product_category right?
… quantities across sales order lines - by product template - by product category
…onstraint conflicts The `product_variant_default_code` module adds a unique constraint, which causes test failures when installed alongside `sale_pricelist_global_rule`. This fix adjusts the tests in to avoid conflicts with this unique constraint, ensuring compatibility when both modules are installed.
If not, we get: ``` Traceback (most recent call last): File "/opt/odoo/custom/src/odoo/odoo/http.py", line 658, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/custom/src/odoo/odoo/http.py", line 301, in _handle_exception raise exception.with_traceback(None) from new_cause psycopg2.errors.DatatypeMismatch: ARRAY types integer and boolean cannot be matched LINE 9: ...L OR item.global_product_tmpl_id = any(ARRAY[false,... ``` A little refactor for better code in the method is also done. TT51677
…putes complementary to commit 637c766
- Reused Odoo's base code for computing pricelists, adapted it to new functions, and simplified the logic. - Renamed selection options for the applied_on field: 4_global_product_template to 3_1_global_product_template and 5_global_product_category to 3_2_global_product_category to ensure the correct order in pricelist items. - Fixed an assertion in the tests. Previously, changing the UoM did not update the price, but this behavior was introduced in PR OCA#2473. - Added a new assertion for the pricelist_item_id field.
Issue introduced in OCA#3150
…tential related errors in other addons.
58dcdfe
to
6966d96
Compare
Thanks for the observation. I added the migration script; please take a look. |
applied_on
field:4_global_product_template
to3_1_global_product_template
and5_global_product_category
to3_2_global_product_category
to ensure the correct order in pricelist items.pricelist_item_id
field.TT52357
@Tecnativa @pedrobaeza @victoralmau could you please review this.